package com.atguigu.crud.service;

import com.atguigu.crud.bean.Department;
import com.atguigu.crud.bean.DepartmentExample;
import com.atguigu.crud.bean.Employee;
import com.atguigu.crud.bean.EmployeeExample;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface EmployeeService {
    long countByExample(EmployeeExample example);


    int deleteByExample(EmployeeExample example);

    int deleteByPrimaryKey(Integer deptId);

    int insert(Department record);

    int insertSelective(Department record);

    List<Department> selectByExample(DepartmentExample example);

    Department selectByPrimaryKey(Integer deptId);

    int updateByExampleSelective(@Param("record") Department record, @Param("example") DepartmentExample example);

    int updateByExample(@Param("record") Department record, @Param("example") DepartmentExample example);

    int updateByPrimaryKeySelective(Department record);

    int updateByPrimaryKey(Department record);

    List<Employee> getAll();

    /**
     * 员工保存
     * @param employee
     */
    void saveEmp(Employee employee);

    /**
     * 检验用户名是否可用
     * @param empName
     * @return
     */
    boolean checkUser(String empName);

    /**
     * 按照员工id查询员工
     * @param id
     * @return
     */
    Employee getEmp(Integer id);


    /**
     * 员工更新
     * @param employee
     */
    void updateEmp(Employee employee);


    /**
     * 员工删除
     * @param id
     */
    void deleteEmp(Integer id);

    void deleteBatch(List<Integer> ids);
}
